import request from '@/utils/request'
import { GET_USER_INFO } from '../constants'

export const getUserInfoAc = (payload) => ({
  type: GET_USER_INFO,
  payload,
})

export const getUserInfo = () => {
  return async (dispatch) => {
    const res = await request.get('/user/profile')
    dispatch(getUserInfoAc(res.data.data))
  }
}
